Integrand size = 23, antiderivative size = 87 \[ \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {1}{8} \left (3 a^2+2 a b+3 b^2\right ) x+\frac {3 \left (a^2-b^2\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {(a-b) \cos ^3(c+d x) \sin (c+d x) \left (a+b \tan ^2(c+d x)\right )}{4 d} \]
1/8*(3*a^2+2*a*b+3*b^2)*x+3/8*(a^2-b^2)*cos(d*x+c)*sin(d*x+c)/d+1/4*(a-b)* cos(d*x+c)^3*sin(d*x+c)*(a+b*tan(d*x+c)^2)/d
Time = 1.47 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.75 \[ \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {4 \left (3 a^2+2 a b+3 b^2\right ) (c+d x)+8 \left (a^2-b^2\right ) \sin (2 (c+d x))+(a-b)^2 \sin (4 (c+d x))}{32 d} \]
(4*(3*a^2 + 2*a*b + 3*b^2)*(c + d*x) + 8*(a^2 - b^2)*Sin[2*(c + d*x)] + (a - b)^2*Sin[4*(c + d*x)])/(32*d)
Time = 0.28 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.22, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4158, 315, 298, 216}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \tan (c+d x)^2\right )^2}{\sec (c+d x)^4}dx\) |
\(\Big \downarrow \) 4158 |
\(\displaystyle \frac {\int \frac {\left (b \tan ^2(c+d x)+a\right )^2}{\left (\tan ^2(c+d x)+1\right )^3}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 315 |
\(\displaystyle \frac {\frac {1}{4} \int \frac {b (a+3 b) \tan ^2(c+d x)+a (3 a+b)}{\left (\tan ^2(c+d x)+1\right )^2}d\tan (c+d x)+\frac {(a-b) \tan (c+d x) \left (a+b \tan ^2(c+d x)\right )}{4 \left (\tan ^2(c+d x)+1\right )^2}}{d}\) |
\(\Big \downarrow \) 298 |
\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \left (3 a^2+2 a b+3 b^2\right ) \int \frac {1}{\tan ^2(c+d x)+1}d\tan (c+d x)+\frac {3 \left (a^2-b^2\right ) \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )+\frac {(a-b) \tan (c+d x) \left (a+b \tan ^2(c+d x)\right )}{4 \left (\tan ^2(c+d x)+1\right )^2}}{d}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \left (3 a^2+2 a b+3 b^2\right ) \arctan (\tan (c+d x))+\frac {3 \left (a^2-b^2\right ) \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}\right )+\frac {(a-b) \tan (c+d x) \left (a+b \tan ^2(c+d x)\right )}{4 \left (\tan ^2(c+d x)+1\right )^2}}{d}\) |
(((a - b)*Tan[c + d*x]*(a + b*Tan[c + d*x]^2))/(4*(1 + Tan[c + d*x]^2)^2) + (((3*a^2 + 2*a*b + 3*b^2)*ArcTan[Tan[c + d*x]])/2 + (3*(a^2 - b^2)*Tan[c + d*x])/(2*(1 + Tan[c + d*x]^2)))/4)/d
3.5.48.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-( b*c - a*d))*x*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] - Simp[(a*d - b*c*( 2*p + 3))/(2*a*b*(p + 1)) Int[(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/2 + p, 0])
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim p[(a*d - c*b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q - 1)/(2*a*b*(p + 1))), x] - Simp[1/(2*a*b*(p + 1)) Int[(a + b*x^2)^(p + 1)*(c + d*x^2)^(q - 2)*S imp[c*(a*d - c*b*(2*p + 3)) + d*(a*d*(2*(q - 1) + 1) - b*c*(2*(p + q) + 1)) *x^2, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, - 1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, 2, p, q, x]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ )])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim p[ff/(c^(m - 1)*f) Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)^n)^ p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && I ntegerQ[m/2] && (IntegersQ[n, p] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Time = 8.14 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.18
method | result | size |
risch | \(\frac {3 x \,a^{2}}{8}+\frac {x a b}{4}+\frac {3 x \,b^{2}}{8}+\frac {\sin \left (4 d x +4 c \right ) a^{2}}{32 d}-\frac {\sin \left (4 d x +4 c \right ) a b}{16 d}+\frac {\sin \left (4 d x +4 c \right ) b^{2}}{32 d}+\frac {\sin \left (2 d x +2 c \right ) a^{2}}{4 d}-\frac {\sin \left (2 d x +2 c \right ) b^{2}}{4 d}\) | \(103\) |
derivativedivides | \(\frac {b^{2} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{3} \sin \left (d x +c \right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(122\) |
default | \(\frac {b^{2} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{3} \sin \left (d x +c \right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(122\) |
3/8*x*a^2+1/4*x*a*b+3/8*x*b^2+1/32/d*sin(4*d*x+4*c)*a^2-1/16/d*sin(4*d*x+4 *c)*a*b+1/32/d*sin(4*d*x+4*c)*b^2+1/4/d*sin(2*d*x+2*c)*a^2-1/4/d*sin(2*d*x +2*c)*b^2
Time = 0.28 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.86 \[ \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {{\left (3 \, a^{2} + 2 \, a b + 3 \, b^{2}\right )} d x + {\left (2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, a^{2} + 2 \, a b - 5 \, b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \]
1/8*((3*a^2 + 2*a*b + 3*b^2)*d*x + (2*(a^2 - 2*a*b + b^2)*cos(d*x + c)^3 + (3*a^2 + 2*a*b - 5*b^2)*cos(d*x + c))*sin(d*x + c))/d
\[ \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \cos ^{4}{\left (c + d x \right )}\, dx \]
Time = 0.31 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.11 \[ \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {{\left (3 \, a^{2} + 2 \, a b + 3 \, b^{2}\right )} {\left (d x + c\right )} + \frac {{\left (3 \, a^{2} + 2 \, a b - 5 \, b^{2}\right )} \tan \left (d x + c\right )^{3} + {\left (5 \, a^{2} - 2 \, a b - 3 \, b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1}}{8 \, d} \]
1/8*((3*a^2 + 2*a*b + 3*b^2)*(d*x + c) + ((3*a^2 + 2*a*b - 5*b^2)*tan(d*x + c)^3 + (5*a^2 - 2*a*b - 3*b^2)*tan(d*x + c))/(tan(d*x + c)^4 + 2*tan(d*x + c)^2 + 1))/d
Leaf count of result is larger than twice the leaf count of optimal. 3916 vs. \(2 (81) = 162\).
Time = 22.62 (sec) , antiderivative size = 3916, normalized size of antiderivative = 45.01 \[ \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\text {Too large to display} \]
1/32*(3*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2 *tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 - 5*pi*b^2 *sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan( c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 12*a^2*d*x*tan(d*x)^4* tan(c)^4 + 8*a*b*d*x*tan(d*x)^4*tan(c)^4 + 12*b^2*d*x*tan(d*x)^4*tan(c)^4 + 3*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2 *tan(c))*tan(d*x)^4*tan(c)^4 - 5*pi*b^2*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d *x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 6*pi*a*b*sgn(2 *tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 - 10*pi*b^2*sgn(2*tan(d*x)^2*t an(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 6*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*s gn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan (d*x)^2*tan(c)^4 - 10*pi*b^2*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x )^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c )^4 + 6*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*t an(c)^4 - 10*b^2*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x )^4*tan(c)^4 - 6*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*ta n(d*x)^4*tan(c)^4 + 10*b^2*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^4 + 24*a^2*d*x*tan(d*x)^4*tan(c)^2 + 16*a*b*d*x*t...
Time = 12.34 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.07 \[ \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=x\,\left (\frac {3\,a^2}{8}+\frac {a\,b}{4}+\frac {3\,b^2}{8}\right )-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (-\frac {5\,a^2}{8}+\frac {a\,b}{4}+\frac {3\,b^2}{8}\right )-{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (\frac {3\,a^2}{8}+\frac {a\,b}{4}-\frac {5\,b^2}{8}\right )}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )} \]